import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';
import { HeaderComponent } from './components/header/header.component';
import { NewsComponent } from './components/news/news.component';
import { HomeComponent } from './components/home/home.component';
import {FormsModule} from "@angular/forms";
import { TodolistComponent } from './components/todolist/todolist.component'; //用脚手架创建的组件会自动加入到app.module.ts中
import {StorageService} from "./services/storage.service"; //引入服务 .相当于app下
import {HttpClientModule,HttpClientJsonpModule} from "@angular/common/http"; //在app.module.ts中引入http服务模块

@NgModule({
  declarations: [ //声明 引入当前项目运行的组件,自定义组件都需要引入并且在这个里面声明
    AppComponent,
    HeaderComponent,
    NewsComponent,
    HomeComponent,
    TodolistComponent //用脚手架创建的组件会自动加入到app.module.ts中
  ],
    imports: [ //引入  当前项目依赖哪些组件
        BrowserModule,
        FormsModule,
        HttpClientModule,//注册模块
        HttpClientJsonpModule//注册模块
    ],
  providers: [
    StorageService, //注册服务
  ],  /*我们定义的服务 */
  bootstrap: [AppComponent]  /*默认启动那个模块 */
})
export class AppModule { } //要暴露的内容
